namespace EyeOpen.Linq
{
	using System.Collections.Generic;
	using System.Linq;

	public static class ObjectEnumerableExtensions
	{
		public static bool Any<T>(this IEnumerable<object> enumerable) 
			where T : class
		{
			return
				enumerable
					.SingleOrDefault<T>() != null;
		}

		public static T SingleOrDefault<T>(this IEnumerable<object> enumerable)
		{
			return
				(T)enumerable
				   	.SingleOrDefault(x => x.GetType() == typeof(T));
		}
	}
}